package io.github.veigara.tcp.device.factory.charger;

/**
 * @author : zhouhx
 * @date : 2025/6/6 13:29
 */

import io.github.veigara.tcp.framework.factory.DeviceComponentFactory;
import io.github.veigara.tcp.framework.protocol.ProtocolDecoder;
import io.github.veigara.tcp.framework.protocol.ProtocolEncoder;
import io.github.veigara.tcp.framework.protocol.ProtocolHandler;
import io.github.veigara.tcp.framework.model.DeviceConnection;
import io.github.veigara.tcp.framework.model.DeviceType;
import io.github.veigara.tcp.device.protocol.charger.ChargingPileDecoder;
import io.github.veigara.tcp.device.protocol.charger.ChargingPileEncoder;
import io.github.veigara.tcp.device.protocol.charger.ChargingPileProtocolHandler;

/**
 * 充电机组件工厂
 */
public class ChargingPileComponentFactory implements DeviceComponentFactory {
    @Override
    public ProtocolHandler createProtocolHandler(DeviceConnection connection) {
        return new ChargingPileProtocolHandler(connection);
    }

    @Override
    public ProtocolDecoder<?> createDecoder() {
        return new ChargingPileDecoder();
    }

    @Override
    public ProtocolEncoder<?> createEncoder() {
        return new ChargingPileEncoder();
    }

    @Override
    public DeviceType getDeviceType() {
        return DeviceType.CHARGING_PILE;
    }
}
